package com.ruoyi.ftrl.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ftrl.mapper.RoomTemperatureMapper;
import com.ruoyi.ftrl.domain.RoomTemperature;
import com.ruoyi.ftrl.service.IRoomTemperatureService;

/**
 * 室温区间设定信息Service业务层处理
 * 
 * @author dihang
 * @date 2024-07-24
 */
@Service
public class RoomTemperatureServiceImpl implements IRoomTemperatureService 
{
    @Autowired
    private RoomTemperatureMapper roomTemperatureMapper;

    /**
     * 查询室温区间设定信息
     * 
     * @param id 室温区间设定信息主键
     * @return 室温区间设定信息
     */
    @Override
    public RoomTemperature selectRoomTemperatureById(Long id)
    {
        return roomTemperatureMapper.selectRoomTemperatureById(id);
    }

    /**
     * 查询室温区间设定信息列表
     * 
     * @param roomTemperature 室温区间设定信息
     * @return 室温区间设定信息
     */
    @Override
    public List<RoomTemperature> selectRoomTemperatureList(RoomTemperature roomTemperature)
    {
        return roomTemperatureMapper.selectRoomTemperatureList(roomTemperature);
    }

    /**
     * 新增室温区间设定信息
     * 
     * @param roomTemperature 室温区间设定信息
     * @return 结果
     */
    @Override
    public int insertRoomTemperature(RoomTemperature roomTemperature)
    {
        roomTemperature.setCreateTime(DateUtils.getNowDate());
        return roomTemperatureMapper.insertRoomTemperature(roomTemperature);
    }

    /**
     * 修改室温区间设定信息
     * 
     * @param roomTemperature 室温区间设定信息
     * @return 结果
     */
    @Override
    public int updateRoomTemperature(RoomTemperature roomTemperature)
    {
        roomTemperature.setUpdateTime(DateUtils.getNowDate());
        return roomTemperatureMapper.updateRoomTemperature(roomTemperature);
    }

    /**
     * 批量删除室温区间设定信息
     * 
     * @param ids 需要删除的室温区间设定信息主键
     * @return 结果
     */
    @Override
    public int deleteRoomTemperatureByIds(Long[] ids)
    {
        return roomTemperatureMapper.deleteRoomTemperatureByIds(ids);
    }

    /**
     * 删除室温区间设定信息信息
     * 
     * @param id 室温区间设定信息主键
     * @return 结果
     */
    @Override
    public int deleteRoomTemperatureById(Long id)
    {
        return roomTemperatureMapper.deleteRoomTemperatureById(id);
    }
}
